#include<iostream>
#include<queue>
using namespace std;
long long n, k;
priority_queue<int> heap;
int main()
{
    cin >> n >> k;
    long long x, sum = 0;
    while (n--)
    {
        cin >> x;
        if (x % 2 == 0)heap.push(x);
        else sum += x;
    }
    while (heap.size() && k--)
    {
        long long tmp = heap.top();
        tmp /= 2;
        heap.pop();
        if (tmp % 2 == 0)heap.push(tmp);
        else sum += tmp;
    }
    while (heap.size())
    {
        sum += heap.top();
        heap.pop();
    }
    cout << sum << endl;
    return 0;
}